/// ****************************************************************************
/// Author:	        Robin Zhu
/// Create Date:	2011-11-1
/// Purpose: 		数据访问上下文集合类文件
/// ****************************************************************************
/// Modify By		Date			Remark
/// Robin           2014-7-9        修复递归读取DataContext集合的问题    
/// ****************************************************************************

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Collections;
using System.Collections.ObjectModel;
using System.Collections.Specialized;
using System.Configuration;

using RB.DataAccess.Configuration;
using System.Reflection;


namespace RB.DataAccess
{
    /// <summary>
    /// 数据访问上下文集合类
    /// </summary>
    [Serializable]
    public class DataContextCollection : NameObjectCollectionBase
    {
        public DataContext this[string key] 
        {
            get
            {
                DataContext result = (DataContext)this.BaseGet(key);
                if (result == null)
                {
                    result = DataContextFactory.Create(key);
                    this[key] = result;
                }
                return result;
            }
            internal set
            {
                this.BaseAdd(key, value);
            }
        }

    }
}
